package com.zhbit.action;

import java.util.Date;
import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;
import com.zhbit.Service.NoticemangerService;
import com.zhbit.table.Notice;

public class InsertnoticeAction extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Notice notice;
	private int id;
	private NoticemangerService ns;
	
	public void setId(int id) {
		this.id = id;
	}
	public int getId() {
		return id;
	}
	public void setNs(NoticemangerService ns) {
		this.ns = ns;
	}
	public NoticemangerService getNs() {
		return ns;
	}
	public void setNotice(Notice notice) {
		this.notice = notice;
	}
	public Notice getNotice() {
		return notice;
	}
	public String execute() throws Exception {
		notice.setPublictime(new Date());
		notice.setPersonid(id);
        ns.insertnotice(notice);
		return SUCCESS;
	}

}
